package fr.ensisa.sunspot.actor.client.mouse;

import fr.ensisa.sunspot.enums.UINT;
import fr.ensisa.sunspot.enums.bVk;
import fr.ensisa.sunspot.enums.dwEvents;


public class Mouse_simulator {

	private Mouse_proxy mp;
	private final int WHEEL_DELTA = 120;
	private final int dwExtraInfo = 0;
	
	private Mouse_proxy getProxy() {
		if (mp==null) mp = new Mouse_proxy();
		return mp;
	}
	
	public void PostMessage(String window, UINT uint, bVk bvk, int i) {
		getProxy().PostMessage(window, uint.value(), bvk.value(), i);
	}
	
	public void SendMessage(String window, UINT uint, bVk bvk, int i) {
		getProxy().PostMessage(window, uint.value(), bvk.value(), i);
	}
	
	public void SetCursorPos(int x, int y) {
		getProxy().SetCursorPos(x, y);
	}
	
	public void CursorUp(int i) {
		getProxy().CursorUp(i);
	}
	
	public void CursorDown(int i) {
		getProxy().CursorDown(i);
	}
	
	public void CursorLeft(int i) {
		getProxy().CursorLeft(i);
	}
	
	public void CursorRight(int i) {
		getProxy().CursorRight(i);
	}
	
	public void Mouse_event(dwEvents dwEvents, int x, int y, int dwData) {
		// dwData * WHEEL_DELTA
		// 1 = 120 ; -1 = -120

		getProxy().Mouse_event(dwEvents.value(), x, y, dwData*WHEEL_DELTA, this.dwExtraInfo);
	}
}
